1. Technical Field of the Invention
This invention relates to a pixel interpolation apparatus for interpolating pixels between pixels of an image for enhancing the resolution of the image and a pixel interpolation program product for causing a computer to operate as the pixel interpolation apparatus.
2. Description of the Related Art
As known, to enlarge an image by enhancing the resolution of the image, several new pixels need to be interpolated between the original pixels of the original image. To interpolate new pixels between the original pixels, a method of copying the pixel value of the original pixel in the coordinates nearest to the new pixel and adopting the pixel value as the pixel value of the new pixel is available, but the image whose resolution is enhance according to the method becomes like a mosaic as the image is seen on an enlarged scale through a magnifying glass. Then, to make the enlarged image a smooth image, usually a method of mathematically estimating the pixel value in coordinates (interpolation point) defined as those of new pixel in a gap of the original pixels of the original image from the pixel values of the several original pixels in the surroundings of the interpolation point is adopted.
Bicubic interpolation and bilinear interpolation are well known as the method of mathematically estimating the pixel value at the interpolation point. Either interpolation basically is a method of weighting each of the pixel values of the several original pixels placed in the surroundings of one interpolation point in response to the distance from each of the original pixels to the interpolation point and adopting the sum total of the weighted pixel values as the pixel value of the interpolation point.
Specifically, the bicubic interpolation is as follows: Operation of assigning a distance value to a cubic polynomial variable z with quartic and later terms ignored in a Taylor expansion expression of an interpolation function (sin πz)/πz, thereby calculating the weight to the pixel value of the original pixel is performed in the longitudinal direction and the lateral direction and the value provided by multiplying the weight in the longitudinal direction by the weight in the lateral direction is adopted as the final weight by which the pixel value of the original pixel is multiplied. In the bicubic interpolation, the pixels to be thus weighted are 16 original pixels in the surroundings of the interpolation point and cubic operation of longitudinal component and cubic operation of lateral component are performed on each of the 16 original pixels. Thus, according to the bicubic interpolation, the interpolation precision is high and a smooth image can be provided although it takes much time in performing the operations.
On the other hand, the bilinear interpolation is as follows: Operation of standardizing the longitudinal and lateral distances of a rectangle area in which an interpolation point is surrounded by four original pixels to one and calculating the inverse distance from the original pixel to the interpolation point (distance between the original pixel existing on the diagonal side of the original pixel and the interpolation point) is performed in the longitudinal direction and the lateral direction and the value provided by multiplying the weight in the longitudinal direction by the weight in the lateral direction is adopted as the final weight by which the pixel value of the original pixel is multiplied. This means that the bilinear interpolation is a method of calculating the inverse distance weighted average at the interpolation point relative to the pixel values of the four original pixels surrounding the interpolation point. As described above, in the bilinear interpolation, the pixels to be weighted are four original pixels in the surroundings of the interpolation point, and linear operation of longitudinal component and linear operation of lateral component are performed on each of the four original pixels. Thus, according to the linear interpolation, the operations can be completed comparatively rapidly although the interpolation precision is not so high (for example, see Japanese Patent No. 3045134)
To interpolate new pixels between original pixels, no original pixel may be placed at a position adjacent to the boundary (margin) of an enlarged image depending on how the coordinates of an interpolation point in the original image are taken. In this case, several interpolation points exist between the original pixel and, the boundary. If an attempt is made to calculate the pixel value of each of the interpolation points using the above-described bilinear interpolation, the pixel value cannot be calculated because four original pixels are not complete in the surroundings of the interpolation point. Then, for the interpolation point adjacent between the original pixel and the boundary, assuming that an original pixel having the same pixel value as the surrounding original pixel exists outside the boundary, an inverse distance weighted average at the interpolation point relative to the pixel values of four original pixels is calculated. Such processing is called boundary value processing.
By the way, an image with moderate change in light and shade like a landscape may be selected as the object whose resolution is to be enhanced; an image with sharp change in light and shade like a geometric pattern such as a check pattern or a solid image like a cartoon may be selected.
If the image with sharp change in light and shade is enlarged using the bilinear interpolation described above, the boundary portion (edge) where light and shade change sharply in the post-enlarged image becomes dim; this is a problem.
For example, if an image of a check pattern as shown in FIG. 16(a) is enlarged using the bilinear interpolation, the post-enlarged image becomes an image where the boundary between white and black squares is extremely unclear as shown in FIG. 16(b). FIG. 17 is a graph to show a pixel value distribution on a line D of the enlarged image shown in FIG. 16 (b). As shown in FIG. 17, the pixel values of the pixels on the boundary between white and black squares and in the proximity of the boundary in the enlarge image provided using the bilinear interpolation distribute linearly. It is also clear from the graph that the boundary between white and black squares is dim.
By the way, to enlarge an image in an information processing apparatus having an insufficient memory capacity like a printer, it may be impossible to perform pixel interpolation processing for the image data of an original image at a time. In this case, the information processing apparatus may divide the image data of the original image into several pieces and may perform the pixel interpolation processing for the divided image data pieces in order.
However, if the pixel interpolation processing is performed separately for the divided image data pieces, when images based on the image data pieces after subjected to the processing are joined as one enlarged image, an image joint may appear in the enlarged image.
For example, if an image made up of lateral and vertical stripes as shown in FIG. 18A is divided into two parts along a line E-E and the divided images are separately enlarged according to the bilinear interpolation and then are joined, the boundary between the white and black stripes on the line E-E in the vertical-striped pattern in the post-joined enlarged image has light and shade change different from light and shade change in any other boundary and joints are conspicuous as shown in FIG. 18B. The phenomenon in which the joints appear occurs if the image is divided in the boundary between the white and black stripes in the vertical-striped pattern and the above-described boundary value processing is performed at the interpolation point adjacent to the division line. Therefore, the phenomenon can occur in not only the check pattern as shown in FIG. 18A, but also a check pattern as shown in FIG. 21, for example.